<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="theme" content="<%= user_theme %>">
    <title><%= content_for?(:title) ? yield(:title) : Setting.app_name %></title>
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta content='True' name='HandheldFriendly'>
    <%= stylesheet_pack_tag "front" %>
    <%= javascript_pack_tag "application", defer: false %>
    <%= csrf_meta_tag %>
    <%= raw Setting.custom_head_html %>
  </head>
  <body data-controller-name="<%= controller_name %>">
    <div class="flex items-stretch header navbar navbar-expand-md">
      <div class="container relative z-50 flex flex-wrap items-center mx-auto md:flex-nowrap">
        <div class="container flex flex-wrap mx-auto">
          <div class="items-center hidden text-xl font-bold navbar-header sm:flex" data-turbolinks-permanent>
            <%= raw Setting.navbar_brand_html %>
          </div>
          <div class="navbar-nav-scroll">
            <%= render "shared/navbar" %>
          </div>
          <div class="flex ml-auto">
            <%= render "shared/usernav" %>
          </div>
        </div>
      </div>
    </div>
    <div id="main" class="container mx-auto">
      <%= render AlertComponent.new %>
      <%= yield %>
    </div>
    <footer class="footer">
      <div class="container mx-auto">
        <%= raw Setting.footer_html %>
      </div>
    </footer>
    <script type="text/javascript" data-turbolinks-eval="false">
      App.root_url = "<%= root_url %>";
      App.asset_url = "<%= Setting.upload_url -%>";
      <% if current_user %>
        App.current_user_id = <%= current_user.id %>;
      <% end %>
    </script>
    <%= yield :scripts %>
  </body>
</html>
